Why Aren’t The Preferences Changing?
Why doesn’t the VisualizerActivity immediately show the correct setting when we come back from the SettingsActivity
The VisualizerActivity doesn’t have access to the SharedPreferences file.
We need to save the settings key and value in a onSaveInstanceState Bundle.
onCreate contains the code for loading the preference but onCreate isn’t called when you navigate back from SettingsActivity.
It’s working as planned; The user should only see the updated screen when the app is rotated.
We are correctly reading the value of the changed preference from SharedPreferences but we also need to write the correct value to SharedPreferences.
Next Concept